<?php

class TravelController extends Application_Model_Controller
{
    public function init()
    {
        $this->view->headScript()->appendFile($this->view->baseUrl() . '/js/travel.js');
        $this->view->headScript()->appendFile($this->view->baseUrl()  . '/js/redactor/redactor.js');
        $this->view->headLink()->appendStylesheet($this->view->baseUrl() . '/js/redactor/css/redactor.css', 'screen');
        $this->view->headTitle('Путешествия');
    }

    public function indexAction()
    {
        $this->view->tplSidebar = 'travel.phtml';
        $mapper = new Application_Model_Mapper(new Application_Model_DbTable_Travels(), new Application_Model_Travel());
        $this->view->travels = $mapper->getCollection(array(), 'status ASC');
    }
}